package com.file.manage.infrastructure.base.dto.base;

import cn.hutool.core.collection.CollUtil;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.List;

/**
 * @author: hsy
 * @date: 2023/4/25 17:30
 * @description:
 */
@EqualsAndHashCode(callSuper = true)
@Data
@Schema(title = "基础树结构DTO")
public class BaseTreeDTO<T extends BaseTreeDTO<?>> extends BaseDTO {
    @Schema(title = "父级id")
    private String parentId;

    @Schema(title = "子级")
    private List<T> children;

    public Boolean hasNext() {
        return CollUtil.isNotEmpty(children);
    }
}
